package net.jwtools.tmt.ui.propertyeditor;

import com.l2fprod.common.propertysheet.DefaultProperty;
import java.util.List;

/**
 *
 * @author Naftali van der Loon
 */
public class ExtendedProperty extends DefaultProperty {
    
    protected Object[] allowedValues;
    private Class displayType;
    
    public ExtendedProperty() {
    }
    
    public ExtendedProperty(Object[] allowedValues) {
        this.allowedValues = allowedValues;
    }
    
    public ExtendedProperty(List<Object> allowedValues) {
        if (allowedValues != null)
            this.allowedValues = allowedValues.toArray();
    }
    
    public void setAllowedValues(Object[] allowedValues) {
        this.allowedValues = allowedValues;
    }
    
    public void setAllowedValues(List allowedValues) {
        if (allowedValues != null)
            setAllowedValues(allowedValues.toArray());
    }

    public Object[] getAllowedvalues() {
        if (this.allowedValues != null)
            return this.allowedValues;
        return new String[] {"---"};
    }

    public Class getDisplayType() {
        return displayType;
    }

    public void setDisplayType(Class displayType) {
        this.displayType = displayType;
    }
    
}
